package state.group;

import java.io.Serializable;

public class ElevatorStruct implements Serializable {

    private static final long serialVersionUID = -4602260147719906124L;

    public static final int MAX_MESSAGE_SIZE = 255;

    public static final int TICKS_BETWEEN_FLOORS = 75;
    public static final byte UP = 1;
    public static final byte DOWN = 0;
    public static final byte IDLE = 2;
    
    public static final byte MAX_FLOORS = 30;

    public byte identifier;
    public int udpPort;
    public byte doorOpen;
    public byte lastKnownFloor;
    public byte ticksToNextFloor;
    public byte direction;
    public byte curDestination;

    public int currentWeight;
    
    public byte[] destinations = new byte[MAX_FLOORS+1];
    
    @Override
    /**
     * 
     */
    public String toString()
    {
        String retVal = "<ElevatorStruct: \n";
        
        retVal += "identifier: " + identifier + "\n";
        retVal += "udpPort: " + udpPort + "\n";
        retVal += "doorOpen: " + doorOpen + "\n";
        retVal += "lastKnownFloor: " + lastKnownFloor + "\n";
        retVal += "ticksToNextFloor: " + ticksToNextFloor + "\n";
        retVal += "direction: " + direction + "\n";
        retVal += "curDestination: " + curDestination + "\n";
        retVal += "currentWeight: " + currentWeight + "\n";
        
        for (int i = 0;i < destinations.length;i++)
        {
            retVal += "destinations[" + i + "]: " + destinations[i] + "\n";
        }
        retVal += ">";
        
        return retVal;
    }

}
